type OnFufilled<V>=(value:V)=>V | Promise<V>
type OnReject=(error:any)=>any
export interface Interceptors<V>{
    onFufilled?:OnFufilled<V>
    onReject?:OnReject
}
//这个地方是功能，也也可以当作类型来使用
class AxionsInterceptors<V>{
    public interceptors:Array<Interceptors<V> | null>=[]
    use(onFufilled?:OnFufilled<V>,onReject?:OnReject){
        this.interceptors.push({
            onFufilled,
            onReject
        })
        return this.interceptors.length-1
    }
    eject(id:number){
        if(this.interceptors[id]){
            this.interceptors[id]=null 
        }
    }
}

export default AxionsInterceptors